import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from "path"
// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    host: "localhost",
    port: 3000,
    open: true,
    proxy:{
      "/api":{
        target:"http://localhost:8080",
        changeOrigin:true,
        rewrite:path=>path.replace(/^\/api/,"/api/v1")
      }
    }
  },
  resolve:{
    alias:[
      {
        find:"@",
        replacement:resolve(__dirname,"src")
      }
    ]
}
})
